#ifndef ENCODE_STREAM
#define ENCODE_STREAM
#include<queue>
typedef unsigned char uchar;
using namespace std;
#include <sys/types.h>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <mutex>
#include <thread>
#include <string>
#include <iostream>
#include <cstring>
#include <arpa/inet.h>
#include <netdb.h>
#include <chrono>
#include <queue>
#include <vector>

class EncodeBuffer{
public:
    EncodeBuffer();
    EncodeBuffer(int size){
        this->size = size;
        encoderFramePtr = new unsigned char[size];
    }
    ~EncodeBuffer(){
        delete[] encoderFramePtr;
    }
 public:
    unsigned char* encoderFramePtr;
    int size;
};



class EncodeStream{
public:
    EncodeStream();
    ~EncodeStream();
public:
    void Push(EncodeBuffer* encodeBuffer);
    EncodeBuffer* Front();
    void Pop();
    void Clear();
    int Size();
public:
    queue<EncodeBuffer*> encodebuffers;
    int size;
    mutex queueMutex;
};



#endif
